import store from "@/store";
import request from "../utils/request";

const verify = () => request.get("/admin/verify");
const login = data => request.post("/admin/login",data);
const logout = () => request.get("/admin/logout");


const uploadImg = data => request.post("/admin/UploadImage",data);

// 充电站管理
const getStation = data => request.get("/admin/power",{params:data});
const addStation = data => request.post("/admin/power",data);
const delStation = data => request.delete("/admin/power",data);
const putStation = data => request.put("/admin/power",data);
const putStationState = data => request.put("/admin/power_status",data);
const stationInfo = data => request.get("/admin/powerInfo",{params:data});
// 充电桩管理
const getPile = data => request.get("/admin/charging",{params:data});
const addPile = data => request.post("/admin/charging",data);
const getPileInfo = data => request.get("/admin//chargingInfo",{params:data});
const putPile = data => request.put("/admin/charging",data);
const putPileState = data => request.put("/admin/charging_status",data);
// 充电枪管理
const addGun = data => request.post("/admin/gun",data);

export default{
    verify,login,logout,
    getStation,addStation,delStation,putStation,stationInfo,putStationState, //充电站
    getPile,addPile,putPile,getPileInfo,putPileState,                        //充电桩
    addGun,                                                                  //充电枪
    uploadImg
}